﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Common;

namespace DBConstruct
{
    /// <summary>
    ///DBConnStringBuilder 连接字符串抽象工厂类
    /// </summary>
    public abstract class DBConnStringBuilderFactory
    {
        protected string _connectionString;
        public string ConnectionString
        {
            get { return _connectionString; }
            set { _connectionString = value; }
        }

        /// <summary>
        /// 无实现构造函数
        /// </summary>
        public DBConnStringBuilderFactory()
        {
        }

        /// <summary>
        /// 添加键值对
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="value">值</param>
        /// <returns>trueORfalse</returns>
        public abstract bool AddKeyValue(string key, object value);

        /// <summary>
        /// 移除指定的ConnectionString中存在的键值对
        /// </summary>
        /// <param name="key">关键字</param>
        /// <returns>trueORfalse</returns>
        public abstract bool RemoveKeyValue(string key);

        /// <summary>
        /// 设置ConnectionString中存在的键的值
        /// </summary>
        /// <param name="key">关键字</param>
        /// <param name="value">设定值</param>
        /// <returns>trueORfalse</returns>
        public abstract bool SetKeyValue(string key, object value);

        /// <summary>
        /// 检查是否存在某一键
        /// </summary>
        /// <param name="key">关键字</param>
        /// <returns>trueORfalse</returns>
        public abstract bool ContainKey(string key);

        /// <summary>
        /// 移除所有键值对
        /// </summary>
        public abstract void ClearAll();
    }
}
